package xyz.heyaoshare.exceptions.code;

/**
 * 错误码 分段
 * @author YueHe
 * @version 0.0.1
 * @since 2025/6/25 上午10:24
 */
public interface ErrorInfo {

    // -------------------------- 基础错误码 ----------------------------
    ErrorCode SUCCESS = new ErrorCode(200, "成功");
    ErrorCode BAD_REQUEST = new ErrorCode(400, "失败");
    ErrorCode SERVER_ERROR = new ErrorCode(500, "服务器开小差,请稍后再试");
    ErrorCode UNAUTHORIZED = new ErrorCode(401, "登录过期");
    ErrorCode FORBIDDEN = new ErrorCode(403, "权限不足");
    ErrorCode METHOD_NOT_ALLOWED = new ErrorCode(405, "请求方法不正确");
    ErrorCode PARAM_ERROR = new ErrorCode(406, "参数错误");
    ErrorCode CAPTCHA_ERROR = new ErrorCode(700, "获取验证码失败");
    ErrorCode CAPTCHA_EXPIRED = new ErrorCode(701, "验证码不存在或已失效");
    ErrorCode CAPTCHA_CODE_ERROR = new ErrorCode(702, "验证码错误");
    ErrorCode ENUM_TYPE_NOT_EXIST = new ErrorCode(901, "类型值错误");
    ErrorCode INVALID_TOKEN = new ErrorCode(902, "登录信息错误");
    ErrorCode UNKNOWN = new ErrorCode(999, "未知错误");

    // -------------------------- 用户及安全相关 10000 - 10199 ----------------------------
    ErrorCode USER_NOT_EXIST = new ErrorCode(10000, "用户不存在");
    ErrorCode USER_IS_DISABLED = new ErrorCode(10001, "您的账号已被禁用！");
    ErrorCode USERNAME_EXITS = new ErrorCode(10002, "用户名已存在");
    ErrorCode INSERT_USER_FAILED = new ErrorCode(10003, "新增用户失败");
    ErrorCode DELETE_USER_FAILED = new ErrorCode(10004, "删除用户失败");
    ErrorCode UPDATE_USER_FAILED = new ErrorCode(10005, "更新用户失败");
    ErrorCode SELECT_USER_FAILED = new ErrorCode(10006, "查询用户失败");
    ErrorCode INSERT_USER_ROLE_FAILED = new ErrorCode(10007, "新增用户角色失败");
    ErrorCode DELETE_USER_ROLE_FAILED = new ErrorCode(10008, "删除用户角色失败");
    ErrorCode UPDATE_USER_ROLE_FAILED = new ErrorCode(10009, "更新用户角色失败");
    ErrorCode SELECT_USER_ROLE_FAILED = new ErrorCode(10010, "查询用户角色失败");
    ErrorCode DEVICE_TYPE_NOT_EXIST = new ErrorCode(10011, "设备类型不存在");
    ErrorCode USER_OR_PASSWORD_ERROR = new ErrorCode(10012, "用户名或密码错误");
    ErrorCode LOGIN_FAILED = new ErrorCode(10013, "登录失败，请重试");

    // -------------------------- 角色相关 10200 - 10299 ----------------------------
    ErrorCode ROLE_CODE_REPEAT = new ErrorCode(10200, "角色编码已存在");
    ErrorCode UPDATE_ROLE_FAILED = new ErrorCode(10201, "更新角色失败");
    ErrorCode DELETE_ROLE_FAILED = new ErrorCode(10202, "删除角色失败");
    ErrorCode INSERT_ROLE_FAILED = new ErrorCode(10203, "新增角色失败");
    ErrorCode ROLE_NOT_EXIST = new ErrorCode(10204, "角色不存在");
    ErrorCode ROLE_IN_USE = new ErrorCode(10205, "角色 {} 已使用,不可删除");
    ErrorCode DELETE_ROLE_MENU_FAILED = new ErrorCode(10206, "删除角色菜单失败");
    ErrorCode INSERT_ROLE_MENU_FAILED = new ErrorCode(10207, "新增角色菜单失败");
    ErrorCode UPDATE_ROLE_STATUS_FAILED = new ErrorCode(10208, "更新角色状态失败");

    // -------------------------- 菜单相关 10300 - 10399 ----------------------------
    ErrorCode MENU_NOT_EXIST = new ErrorCode(10300, "菜单不存在");
    ErrorCode UPDATE_MENU_FAILED = new ErrorCode(10301, "更新菜单失败");
    ErrorCode DELETE_MENU_FAILED = new ErrorCode(10302, "删除菜单失败");
    ErrorCode INSERT_MENU_FAILED = new ErrorCode(10303, "新增菜单失败");
    ErrorCode MENU_PARENT_IS_SELF = new ErrorCode(10304, "上级菜单不能设置为自己");
    ErrorCode DELETE_ROLE_MENU_REL_FAILED = new ErrorCode(10305, "删除角色菜单关联信息失败");

    // -------------------------- 字典相关 10400 - 10499 ----------------------------
    ErrorCode DICT_TYPE_REPEAT = new ErrorCode(10400, "字典类型已存在");
    ErrorCode UPDATE_DICT_TYPE_FAILED = new ErrorCode(10401, "更新字典类型失败");
    ErrorCode DELETE_DICT_TYPE_FAILED = new ErrorCode(10402, "删除字典类型失败");
    ErrorCode INSERT_DICT_TYPE_FAILED = new ErrorCode(10403, "新增字典类型失败");
    ErrorCode DICT_VALUE_REPEAT = new ErrorCode(10404, "字典值已存在");
    ErrorCode UPDATE_DICT_DATA_FAILED = new ErrorCode(10405, "更新字典数据失败");
    ErrorCode DELETE_DICT_DATA_FAILED = new ErrorCode(10406, "删除字典数据失败");
    ErrorCode INSERT_DICT_DATA_FAILED = new ErrorCode(10407, "新增字典数据失败");
    ErrorCode DICT_DATA_NOT_EXIST = new ErrorCode(10408, "字典数据不存在");
    ErrorCode DICT_TYPE_NOT_EXIST = new ErrorCode(10409, "字典类型不存在");

    // -------------------------- 日志相关 10500 - 10599 ----------------------------
    ErrorCode LOG_SAVE_FAILED = new ErrorCode(10500, "日志保存失败");

    // -------------------------- 文件相关 10600 - 10699 ----------------------------
    ErrorCode MINIO_FILE_CONVERSION_FAILED = new ErrorCode(10600, "文件转换失败");
    ErrorCode MINIO_BUILD_POLICY_FAILED = new ErrorCode(10601, "生成策略失败");
    ErrorCode CREATE_SHARE_FAILED = new ErrorCode(10602, "创建分享失败");
    ErrorCode FILE_INFO_EXIST = new ErrorCode(10603, "文件不存在");
    ErrorCode FILE_DOWNLOAD_FAILED = new ErrorCode(10604, "文件下载失败");

}